[NET] linux: Kill the WARN_ON() calls for checksum fixups.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 14 Aug 2006 12:55:17 +0000 (13:55 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 14 Aug 2006 12:55:17 +0000 (13:55 +0100)
This changeset is from upstream Linux.  We need it so Xen users
using NAT are not unnecessarily alarmed by these WARN_ON errors
especially since they're not in a position to do anything about
it.  Original changelog:

        [NET]: Kill the WARN_ON() calls for checksum fixups.

        We have a more complete solution in the works, involving
        the seperation of CHECKSUM_HW on input vs. output, and
        having netfilter properly do incremental checksums.

        But that is a very involved patch and is thus 2.6.19
        material.

        What we have now is infinitely better than the past,
        wherein all TSO packets were dropped due to corrupt
        checksums as soon at the NAT module was loaded.  At
        least now, the checksums do get fixed up, it just
        isn't the cleanest nor most optimal solution.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
linux-2.6-xen-sparse/net/core/dev.c
patches/linux-2.6.16.13/net-gso-4-kill-warnon.patch [new file with mode: 0644]

index 1ec7390ce6f5d8fe2b4c4d74a9b535e0009dd806..ef92b788f0978407b1d902aa7ea2dcf4273f01db 100644 (file)
@@ -1093,11 +1093,6 @@ int skb_checksum_help(struct sk_buff *skb, int inward)
                goto out_set_summed;
 
        if (unlikely(skb_shinfo(skb)->gso_size)) {
-               static int warned;
-
-               WARN_ON(!warned);
-               warned = 1;
-
                /* Let GSO fix up the checksum. */
                goto out_set_summed;
        }
@@ -1147,11 +1142,6 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
        __skb_pull(skb, skb->mac_len);
 
        if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
-               static int warned;
-
-               WARN_ON(!warned);
-               warned = 1;
-
                if (skb_header_cloned(skb) &&
                    (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
                        return ERR_PTR(err);
diff --git a/patches/linux-2.6.16.13/net-gso-4-kill-warnon.patch b/patches/linux-2.6.16.13/net-gso-4-kill-warnon.patch
new file mode 100644 (file)
index 0000000..caefc4a
--- /dev/null
@@ -0,0 +1,29 @@
+508c578140642a641bb9b888369719c510ae2a00
+diff --git a/net/core/dev.c b/net/core/dev.c
+index e814a89..240773b 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -1087,11 +1087,6 @@ int skb_checksum_help(struct sk_buff *sk
+               goto out_set_summed;
+       if (unlikely(skb_shinfo(skb)->gso_size)) {
+-              static int warned;
+-
+-              WARN_ON(!warned);
+-              warned = 1;
+-
+               /* Let GSO fix up the checksum. */
+               goto out_set_summed;
+       }
+@@ -1141,11 +1136,6 @@ struct sk_buff *skb_gso_segment(struct s
+       __skb_pull(skb, skb->mac_len);
+       if (unlikely(skb->ip_summed != CHECKSUM_HW)) {
+-              static int warned;
+-
+-              WARN_ON(!warned);
+-              warned = 1;
+-
+               if (skb_header_cloned(skb) &&
+                   (err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC)))
+                       return ERR_PTR(err);